
#include <bits/stdc++.h>

const int N = 1e6 + 10;

using namespace std;
int a[N],b[N];
int find(int cur)
{
	int l = 1, r = n;
	while(l < r)
	{
		int mid = l + r >> 1;
		if(a[mid] < cur)l = mid + 1;
		else if(a[mid] > cur) r = mid;
		else return mid;
	}
	return 0;
}
//bst 迭代查找
template<typename T>
Node<T>* Tree<T>::search_iterator(T key) 
{
    Node<T>* pnode=root;
    while (pnode!= nullptr)
    {
        if(pnode->value==key)
        {
            return pnode;
        }
        else if(pnode->value>key)
        {
            pnode=pnode->lchild;
        }
        else if(pnode->value<key)
        {
            pnode=pnode->rchild;
        }

    }
    return nullptr;//没找到
}
//bst 递归查找
template<typename T>
Node<T>* Tree<T>::search(Node<T>* &pnode,T key)
{
    if(pnode== nullptr) return nullptr;
    if(pnode->value==key)
    {
        return pnode;
    }
    if(key>pnode->value)
    {
        return search(pnode->rchild,key);
    }
    else
    {
        return search(pnode->lchild,key);
    }
}
void slove()
{
	
}
int main() {
	int T = 1;
	//cin >> T;
	while(T--)slove();



	return 0;
}

